<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    {:token()}
    <input type="hidden" name="row[id]" value="{$row.id}">

    {if $group_id==1|| $group_id==2}
    <div class="form-group">
        <label for="company_id" class="control-label col-xs-12 col-sm-2">{:__('区县公司')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-company_id" min="0" data-rule="required" data-source="ajax/subsidiaryList"
                class="form-control selectpage" name="row[company_id]" data-title="name" type="text"
                value="{$row.company_id|htmlentities}">
        </div>
    </div>
    {/if}
    <input type="hidden" id="c-admin_id" value="{$admin_id}">
    {if $group_id==5||$group_id==1||$group_id==2}
    <div class="form-group">
        <label for="c-category_id" class="control-label col-xs-12 col-sm-2">{:__('工厂类型')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-category_id" min="0" data-rule="required" data-source="factory/Category/index"
                data-field="title" class="form-control selectpage" name="row[category_id]" type="text"
                value="{$row.category_id|htmlentities}" data-params='{"custom[admin_id]":"{$admin_id}"}'>
        </div>
    </div>
    {/if}
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-username" data-rule="required" class="form-control" name="row[username]" type="text"
                value="{$row.username|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-nickname" data-rule="required" class="form-control" name="row[nickname]" type="text"
                value="{$row.nickname|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('门店联系人')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-password" data-rule="password" class="form-control" name="row[password]" type="password"
                value="" placeholder="{:__('Leave password blank if dont want to change')}"
                autocomplete="new-password" />
        </div>
    </div>
    <!-- <div class="form-group">
        <label for="c-email" class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-email" data-rule="" class="form-control" name="row[email]" type="text" value="{$row.email|htmlentities}">
        </div>
    </div> -->
    <div class="form-group">
        <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('手机号')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-mobile" data-rule="" class="form-control" name="row[mobile]" type="text"
                value="{$row.mobile|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-avatar" class="control-label col-xs-12 col-sm-2">{:__('头像')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-avatar" data-rule="" class="form-control" size="50" name="row[avatar]" type="text"
                    value="{$row.avatar}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-avatar" class="btn btn-danger faupload"
                            data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                            data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i>
                            {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-avatar" class="btn btn-primary fachoose"
                            data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false"><i
                                class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-avatar"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-avatar"></ul>
        </div>
    </div>

    <!-- <div class="form-group">
        <label for="c-money" class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-money" data-rule="required" class="form-control" name="row[money]" type="number" value="{$row.money}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-score" class="control-label col-xs-12 col-sm-2">{:__('Score')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-score" data-rule="required" class="form-control" name="row[score]" type="number" value="{$row.score}">
        </div>
    </div> -->
    <!-- <div class="form-group">
        <label for="c-successions" class="control-label col-xs-12 col-sm-2">{:__('Successions')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-successions" data-rule="required" class="form-control" name="row[successions]" type="number" value="{$row.successions}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-maxsuccessions" class="control-label col-xs-12 col-sm-2">{:__('Maxsuccessions')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-maxsuccessions" data-rule="required" class="form-control" name="row[maxsuccessions]" type="number" value="{$row.maxsuccessions}">
        </div>
    </div> -->
    <!-- <div class="form-group">
        <label for="c-prevtime" class="control-label col-xs-12 col-sm-2">{:__('Prevtime')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-prevtime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[prevtime]" type="text" value="{$row.prevtime|datetime}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-logintime" class="control-label col-xs-12 col-sm-2">{:__('Logintime')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-logintime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[logintime]" type="text" value="{$row.logintime|datetime}">
        </div>
    </div> -->
    <!-- <div class="form-group">
        <label for="c-loginip" class="control-label col-xs-12 col-sm-2">{:__('Loginip')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-loginip" data-rule="required" class="form-control" name="row[loginip]" type="text" value="{$row.loginip}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-loginfailure" class="control-label col-xs-12 col-sm-2">{:__('Loginfailure')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-loginfailure" data-rule="required" class="form-control" name="row[loginfailure]" type="number" value="{$row.loginfailure}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-joinip" class="control-label col-xs-12 col-sm-2">{:__('Joinip')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-joinip" data-rule="required" class="form-control" name="row[joinip]" type="text" value="{$row.joinip}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-jointime" class="control-label col-xs-12 col-sm-2">{:__('Jointime')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-jointime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[jointime]" type="text" value="{$row.jointime|datetime}">
        </div>
    </div> -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">是否需要收费:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-is_fee" name="row[is_fee]" type="hidden" value="{$row.is_fee}">
            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-is_fee" data-yes="1" data-no="0" >
                <i class="fa fa-toggle-on text-success {eq name="$row.is_fee" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
            </a>
        </div>
    </div>
    <div class="form-group fee" {if $row['is_fee'] == 0}style="display:none;"{/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('收费设置')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl class="fieldlist" data-name="row[fee_items]" data-template="itemtpl">
                <dd>
                    <ins>收费项</ins>
                    <ins>金额(元)</ins>
                </dd>
                <textarea name="row[fee_items]" class="form-control hide" cols="30" rows="5">{$fee_items}</textarea>
            </dl>
            <!--定义模板，模板语法使用Art-Template模板语法-->
            <script type="text/html" id="itemtpl">
                <dd class="form-inline">
                    <input type="text" name="row[<%=name%>][<%=index%>][item]" class="form-control" value="<%=row['item']%>" size="30" readonly>
                    <input type="text" name="row[<%=name%>][<%=index%>][amount]" class="form-control" value="<%=row['amount']%>" size="30">
                </dd>
            </script>
            <span class="text-red">备注：保证金有退款功能，不能删除和改文字，其他收费选项可到系统设置->字典配置中设置</span>
        </div>
    </div>
    <div class="form-group">
        <label for="c-idcard_face" class="control-label col-xs-12 col-sm-2">{:__('Idcard_face')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-idcard_face" data-rule="" class="form-control" size="50" name="row[idcard_face]" type="text" value="{$row.idcard_face}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-idcard_face" class="btn btn-danger faupload" data-input-id="c-idcard_face" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-idcard_face"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-idcard_face" class="btn btn-primary fachoose" data-input-id="c-idcard_face" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-idcard_face"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-idcard_face"></ul>
        </div>
    </div>
    <div class="form-group">
        <label for="c-idcard_emblem" class="control-label col-xs-12 col-sm-2">{:__('Idcard_emblem')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-idcard_emblem" data-rule="" class="form-control" size="50" name="row[idcard_emblem]" type="text" value="{$row.idcard_emblem}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-idcard_emblem" class="btn btn-danger faupload" data-input-id="c-idcard_emblem" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-idcard_emblem"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-idcard_emblem" class="btn btn-primary fachoose" data-input-id="c-idcard_emblem" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-idcard_emblem"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-idcard_emblem"></ul>
        </div>
    </div>
    <div class="form-group">
        <label for="c-business_license" class="control-label col-xs-12 col-sm-2">{:__('Business_license')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-business_license" data-rule="" class="form-control" size="50" name="row[business_license]" type="text" value="{$row.business_license}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-business_license" class="btn btn-danger faupload" data-input-id="c-business_license" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-business_license"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-business_license" class="btn btn-primary fachoose" data-input-id="c-business_license" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-business_license"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-business_license"></ul>
        </div>
    </div>
    <div class="form-group">
        <label for="c-contract_file" class="control-label col-xs-12 col-sm-2">{:__('Contract_file')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-contract_file" data-rule="" class="form-control" size="50" name="row[contract_file]" type="text" value="{$row.contract_file}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-contract_file" class="btn btn-danger faupload" data-input-id="c-contract_file" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-contract_file"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-contract_file" class="btn btn-primary fachoose" data-input-id="c-contract_file" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-contract_file"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-contract_file"></ul>
        </div>
    </div>
    <div class="form-group">
        <label for="c-bank_image" class="control-label col-xs-12 col-sm-2">{:__('Bank_image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-bank_image" data-rule="" class="form-control" size="50" name="row[bank_image]" type="text" value="{$row.bank_image}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-bank_image" class="btn btn-danger faupload" data-input-id="c-bank_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-bank_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-bank_image" class="btn btn-primary fachoose" data-input-id="c-bank_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-bank_image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-bank_image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])}
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>